
#include<memory>
#include"udpclient.hpp"
using namespace udpClient;
static void startrouine(string proc)
{
    cout<<"\nstartroutine\n\t" <<proc<<"serverip serverport"<<endl;
}


int main(int argc,char* argv[])
{
    if(argc!=3)
    {
        startrouine(argv[0]);
        exit(1);
    }

    string serverip=argv[1];
     uint16_t serverport=atoi(argv[2]);//atoi作用：把port的str类型转化成int类型。而uin16_t本质类型是int

unique_ptr<udpclient> uct(new udpclient(serverip,serverport));

uct->initclient();
uct->run();

    return 0;
}